package se.webbzon.boltzmann.game.object.dialogue.word;

import java.awt.Color;

import javax.media.j3d.Transform3D;
import javax.vecmath.Vector3d;

import se.webbzon.boltzmann.game.object.dialogue.layout.DialogueLayout;
import se.webbzon.oschi01.worldobject.appearance.TextAppearance3D;

public class DividedDialogueCharacter extends TextAppearance3D {
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new divided dialogue character from a given character. **/
	public DividedDialogueCharacter(DialogueLayout layout, 
									char character, 
									Color color) {
		super(	0,
				TextAppearance3D.ALIGN_LEFT+
				TextAppearance3D.ALIGN_TOP+
				TextAppearance3D.LAYERS+
				TextAppearance3D.KEEP_PROPORTIONS,
				SimpleDialogueWord.getDefaultFont(),
				Character.toString(character));
		setLayer(0,0,1);
		setColor(color);
		
		final Transform3D transform = new Transform3D();
		final Vector3d scaling = 
				new Vector3d(	layout.getCharacterWidth(),
								layout.getCharacterHeight(), 
								1);
		transform.setScale(scaling);
		setTransform(transform);	
	}

}
